# !usr/bin/env python
# -*-coding:utf-8 -*-

# @FileName: send_.py
# @Author:tian
# @Time:06/19/2021

import pika
import time

connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
# 创建一个名为balance的队列
channel.queue_declare(queue='balance')

msg = 'this is css program.'

for i in range(10):
    channel.basic_publish(exchange='',routing_key='balance',body=msg)
    print(f'[{i}] Sent "content"')
    time.sleep(0.2)

connection.close()

